<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>

<head>
	<title>用户管理</title>
	<style type="text/css">
	span{
		display:inline-block;
	}
	
	span label{
		display:inline-block;
	}
	.controls label{
		display:inline-block;
	}
	</style>
	<script>
	
	var zNodes;
	var setting = {
		check: {
			enable: false
		},
	     data: {
	         simpleData: {
	             enable: true
	         }
	     }
	};
		$(document).ready(function() {
			//加载树
			 $.ajax({
		          	type: "POST",    
		          	url: "${ctx}/user/tree/viewUserTree/${user.id}",                
		          	dataType: "text",
		          	global: false,
		          	async: false,                      
		           	success: function (data) 
		           	{   
		          		zNodes=eval(data);
		          	},          
		          	error: function () {
		          		alert("Ajax请求数据失败!");
		        	}
			});
			$.fn.zTree.init($("#tree"), setting, zNodes);
			getFrameHeight();
		});
		function back(){
			window.location = "${ctx}/user/user";
		}
	</script>
</head>

<body>
       	<div>
               <div id="jCrumbs" class="breadCrumb module">
 					<ul>
				       <li>
				           <a href="#"><i class="icon-home" style="margin-top: 2px;"></i></a>
				       </li>
				       <li>
				            	用户管理
				       </li>
		    </ul>
		</div>					                    
	<div class="row-fluid">
 			<div class="span12">
 			<div style="float:right">
				<button class="btn" type="button"  onclick="back()">返 回</button>
			</div>
      		<h3 class="heading">用户信息</h3>
			<div class="row-fluid">
				<div class="span8">
						<form:form id="inputForm" name="inputForm" modelAttribute="user" cssClass="form-horizontal"
								action="" method="post">
							<input type="hidden" name="authCodeString" id="authCodeString" value=""/>
							<input type="hidden" name="id" id="id" value="${user.id}"/>	
							<fieldset>
								<div class="control-group formSep">
									<label for="u_fname" class="control-label"><font color="red">*</font>用户名:</label>
                					<div class="controls">
										${user.loginName}
									</div>
								</div>
								 <div class="control-group formSep">
									<label for="fileinput" class="control-label">邮箱:</label>
									<div class="controls">
										${user.email}
									</div>
								</div> 
								<div class="control-group formSep">
									<label for="fileinput" class="control-label">电话:</label>
									<div class="controls">
										${user.mobile}
									</div>
								</div> 
								<div class="control-group formSep">
									<label for="fileinput" class="control-label">用户描述:</label>
									<div class="controls">
									${user.descpt}
									</div>
								</div>
								
								
								<div class="control-group formSep" id="AUTH_EDIT">
									<label for="u_fname" class="control-label"><font color="red">*</font>用户权限:</label>
									<div class="controls">
										<div class="zTreeDemoBackground left">
											<ul id="tree" class="ztree"></ul>
										</div>
									</div>
								</div>
								<div class="control-group">
									<div class="controls">
										<button class="btn btn-gebo"  type="button"  onclick="back()">返 回</button>
									</div>
								</div>
							</fieldset>
						</form:form>
					</div>
				</div>
   			</div>
		</div>
     </div>
</body>
</html>
